import { AppRouteObject } from '#/router.ts';
import { DataNavIcon } from '@ycx/ui';
import { Navigate } from 'react-router-dom';
import RoleManagement from '@/pages/system/roleManagement';
import AccountManagement from '@/pages/system/accountManagement';

const settings: AppRouteObject = {
  path: 'settings',
  meta: {
    label: '系统设置',
    key: '/settings',
    icon: <DataNavIcon style={{ fontSize: '24px' }} />,
    disabled: true,
    permissions: ['SYSTEM_SETTING'],
  },
  children: [
    {
      index: true,
      element: <Navigate to={'/settings/role-manage'} replace />,
    },
    {
      path: 'role-management',
      meta: {
        label: '角色管理',
        key: '/settings/role-management',
        permissions: ['ROLE_MANAGER'],
        icon: <DataNavIcon style={{ fontSize: '24px' }} />,
      },
      element: <RoleManagement />,
    },
    {
      order: 1,
      path: 'account-management',
      meta: {
        label: '账号管理',
        key: '/settings/account-management',
        permissions: ['ACCOUNT_MANAGER'],
        icon: <DataNavIcon style={{ fontSize: '24px' }} />,
      },
      element: <AccountManagement />,
    },
  ],
};

export default settings;
